/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/3/15
 * Time: 16:09
 * Description: No Description
 */
public class TestDemo {
    public int divide(int dividend, int divisor) {
        int count=0;
        int num = 0;
        if(dividend == -1&&divisor!=-1) {
            return -1;
        }else if(divisor==-1 &&dividend==-1 ) {
            return 1;
        }
        if(divisor == 0 ||dividend < divisor) {
            return 0;
        }else if(divisor < 0) {
            divisor = -divisor;
            while(num+divisor <= dividend) {
                num += divisor;
                count++;
            }
            return -count;
        }


        while(num+divisor <= dividend) {
            num += divisor;
            count++;
        }
        return count;

    }
    public int[] swapNumbers(int[] numbers) {
        numbers[0] = numbers[0]^numbers[1];
        numbers[1] = numbers[0]^numbers[1];
        numbers[0] = numbers[0]^numbers[1];
        return numbers;
    }

        int sum =0;
        public int sumNums(int n) {

            boolean x = n==1 || sumNums(n-1)>0;
            sum+=n;
            return sum;
        }
    public static void ADD(int a) {
        if(a > 9) {
            ADD(a/10);
        }
        System.out.print(a%10+" ");
    }
    public static void main3(String[] args) {
        ADD(123);
    }
//    public static int multiply(int A, int B) {
//        if(B == 1) {
//            return A;
//        }
//        return A + multiply(A,B - 1);
//
//    }
//}
//    public static void main2(String[] args) {
//        System.out.println(multiply(3, 4));
//    }
//    public static int getSum(int a, int b) {
//        int num = 0;
//        int sum = 0;
//        num = (a & b ) << 1;
//        sum = a ^ b;
//        return sum+num;
//    }
//    public static void main1(String[] args) {
//        System.out.println(getSum(10, 20));
//    }
}